/*
 tasks and functions test
*/

module cucu;
 reg [7:0] a, b, c;

 task fff;
  begin
   a = b[3:0];
   $display("%m    a = %d", a);
  end
 endtask

 function[7:0] f;
  input[7:0] i1;
  begin
   f = i1 + 1;
   $display("%m = %d", f);
  end
 endfunction

 function real fr;
  input[7:0] i;
  begin
   fr = i+2;
   $display("%m = %d", fr); 
  end
 endfunction

 initial begin
    b = 10;
    fff();
    $display("a = %d", a);
    a = f(b);
    $display("a = %d", a);
    a = fr(b);
    $display("a = %d", a);
 end
endmodule
